package gitbook.ctrl;

import gitbook.Spitter;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("spitter")
public class SpitterCtrl {
    @RequestMapping("save")
    public void save(Spitter spitter){
        System.out.println("save");
    }

    @RequestMapping("me")
    public String me(Model model){
        Spitter spitter = new Spitter();
        spitter.setUsername("USERNAME");
        model.addAttribute("spitter",spitter);
        return "spitterInfo";
    }

    @RequestMapping("form")
    public void register(){
        System.out.println("register");
    }

    @RequestMapping("sysinfo")
    public void sysinfo(){
        System.out.println("sysinfo");
    }

    @RequestMapping("login")
    public String login(){
        return "login";
    }

//    @RequestMapping("logout")
//    public String logout(){
//        return "loginout";
//    }
}
